from random import randint

from flask import Flask, render_template

app = Flask(__name__)

heros = ['黑暗之女', '狂战士', '正义巨像', '卡牌大师', '德邦总管', '无畏战车',
        '诡术妖姬', '猩红收割者', '远古恐惧', '正义天使', '无极剑圣', '牛头酋长']


@app.route('/index')
def index():
    return render_template('index.html', heros=heros)


@app.route('/extract')
def extract():
    num = randint(0, len(heros))
    return render_template('index.html', heros=heros, hero=heros[num])


app.run(debug=True)
